package org.langqiao.genericity;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

public class TestErasure2 {

	
	public static void main(String[] args) {
		List<String> list1 = new ArrayList<String>();
		list1.add("1");
		list1.add("2");
		List list = list1;
		List<String> list2 = list;
		List<Long> list3 = list;
		System.out.println(list3.size());
		System.out.println(list3.get(0));
		
		
		
		List<String> l1 = new ArrayList<String>();
		List<Integer> l2 = new ArrayList<Integer>();
		Field[] fs = l1.getClass().getDeclaredFields();
		for ( Field f:fs) {
		    System.out.println("Field name "+f.getName()+" type:"+f.getType().getName());
		}
		
		System.out.println(l1.getClass());
		System.out.println(l2.getClass());
		System.out.println(l1.getClass() == l2.getClass());
		
	}

}
